<!DOCTYPE html>
<html lang='en'>

<head>
    <meta charset='UTF-8'>
    <meta name='viewport' content='width=device-width, initial-scale=1.0'>
    <title>Document</title>
    <script type='text/javascript' src='js/vue.js'></script>
</head>

<body>
    <div id='app'>
        {{msg}}
        <input type="text" v-aa='msg2' >
        <input type="text" v-bb='msg' value='bbbbbbb'>
        <!-- <input type="text" v-cc='msgc' value='bbbbbbb'> -->
    </div>

    <script type='text/javascript'>

        Vue.directive('aa', {
            inserted(el,binding) {
                console.log(binding, 777);
                el.focus()
                 el.value=binding.value.dd
                el.style.color=binding.value.color
            },
            bind(qq){
                console.log(qq, 888);
            }
        })

        var vm = new Vue({
            el: '#app',
            data: {
                msg: 'Hello Vue',
                msgc: 'ccccc',
                msg2:{
                    color:'red'
                }
            },
            directives:{
                bb:{
                    inserted(el,binding){
                        console.log(binding.value,1111);
                        el.value=binding.value
                        el.style.color='blue'
                    }
                },
                cc:{
                    inserted(el,binding){
                        console.log(binding.value,1111);
                        el.value=binding.value
                        el.style.color='green'
                    }
                }
            }
        });


       
    </script>
</body>

</html>